package com.ddtc.repo;

import com.ddtc.object.WxAppId;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

/**
 * Created by dingd on 2018-07-29.
 */
public interface WxAppIdRepository extends CrudRepository<WxAppId,Integer> {

    @Query(nativeQuery = true,value = "select w.appSecret from t_weixin_appid w where w.appId = :appId ")
    String findAppSecret(@Param("appId") String appId);

    @Query(nativeQuery = true,value = "select * from t_weixin_appid w where w.oldId = :oldId ")
    WxAppId findWxAppId(@Param("oldId") String oldId);


    WxAppId findByAppSecret(String appId);

    WxAppId findByAppId(String appId);
}


